//
//  Student.m
//  归档-2-任意对象的归档
//
//  Created by 沈家林 on 15/8/24.
//  Copyright (c) 2015年 沈家林. All rights reserved.
//

#import "Student.h"
#import "NSObject+MZBlockKVO.h"

@implementation Student

//归档方法
-(void)encodeWithCoder:(NSCoder *)aCoder{
    //当学生被归档，学生要将成员都归档
//    [aCoder encodeObject:_name forKey:@"name"];
//    [aCoder encodeInteger:_age forKey:@"age"];
    [self mzSaveAllAttrWithCoder:aCoder];
}

//解归档方法
-(id)initWithCoder:(NSCoder *)aDecoder{
    if (self=[super init]) {
        //当学生被解归档，学生要将成员都解归档
//        _name=[aDecoder decodeObjectForKey:@"name"];
//        _age=[aDecoder decodeIntegerForKey:@"age"];
        [self mzReadAllAttrWithDecoder:aDecoder];
    }
    return self;
}


@end
